package com.seezoon.interfaces;

import com.seezoon.application.device.dto.SoundRecordingCmd;
import com.seezoon.application.device.executor.SoundRecordingExe;
import com.seezoon.infrastructure.dto.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/device")
@Tag(name = "设备控制", description = "录音、重启、围栏操作等")
public class DeviceController {

    private final SoundRecordingExe soundRecordingExe;

    @Operation(summary = "录音")
    @PostMapping("/sound_recording")
    public Response soundRecording(@RequestBody SoundRecordingCmd soundRecordingCmd) {
        return soundRecordingExe.execute(soundRecordingCmd);
    }
}
